<?php
require_once dirname(__FILE__).'/lib/nusoap.php';
class Response {
	private $__config, $__apiconfig;
	function __construct($config){
		$this->__config = &$config;
		$this->__apiconfig = $this->__config->get('API')->get('APISERVERSOAP');		
	}
	
	function __destruct(){
		
	}
	
	public function toString(){
	//	if (!$this->__apiconfig->get("APISERVERSOAP")) return "FAIL";
		require_once dirname(__FILE__).'/libapi/apifucs.php';
		$soap = new soap_server();
		
		$soap->configureWSDL('SERVERSOAPAPI', 'urn:SERVERSOAPAPI', 'http://localhost/vidbox/?mod=api&amp;api_mod=server');
		$soap->register('execSql', array('sql' => 'xsd:string'),        // input parameters
							    array('return' => 'xsd:string'),      // output parameters
							    'urn:SERVERSOAPAPI',                      // namespace
							    'urn:SERVERSOAPAPI#execSql',                // soapaction
							    'rpc',                                // style
							    'encoded'                            // use
							);
		$soap->register('fetch', array('sql' => 'xsd:string'),        // input parameters
							    array('return' => 'xsd:string'),      // output parameters
							    'urn:SERVERSOAPAPI',                      // namespace
							    'urn:SERVERSOAPAPI#fetch',                // soapaction
							    'rpc',                                // style
							    'encoded'                            // use
							);
		$soap->service($HTTP_RAW_POST_DATA);
		return ;
	}
}
?>